#include <iostream>
using namespace std;

class A{
public:
	~A(){
	//	delete this;
		cout<<"~A()"<<endl;
	}
	void f(){
		delete this;
		a = 3;
		cout<<a<<endl;
	}
	int a;
};

int main(){
	A* a = new A;
	a->f();
//	delete a;
	
	return 0;
} 
